package com.kaisheng.dao;

import java.sql.ResultSet;
import java.sql.SQLException;


import com.kaisheng.entity.UserProject;
import com.kaisheng.util.DBHelp;
import com.kaisheng.util.RowMapper;

public class SimpleUserProjectDao {

	DBHelp<UserProject> db = new DBHelp<UserProject>();
	
	public class SimpleUserProjectRowMapper implements RowMapper<UserProject>{

		public UserProject mapRow(ResultSet rs) throws SQLException {
			UserProject up = new UserProject();
			up.setUser_id(rs.getString("user_id"));
			up.setProject_id(rs.getString("project_id"));
			up.setRole(rs.getString("role"));
	
			return up;
		}
		
		
	}

	public void deleteItemByProjectId(String project_id) {
		String sql = "DELETE  FROM t_user_project WHERE project_id = ?";
		db.executeSQL(sql, project_id);
		
	}
}
